<meta charset="utf-8">
<title>${title!}</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
    content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="${ctxPath}/layui/css/layui.css" media="all">
<link rel="stylesheet" href="${ctxPath}/layui/css/layui-theme-dark.css" media="all">
<script src="${ctxPath}/jquery/js/jquery.min.js"></script>
<script src="${ctxPath}/layui/layui.js"></script>

<!--<script src="${ctxPath}/tools/tools.js"></script>-->
<script type="text/javascript">
    var CXL = {
        ctxPath: "",
        addCtx: function (ctx) {
            if (this.ctxPath === "") {
                this.ctxPath = ctx;
            }
        }
    };
    CXL.addCtx("${ctxPath}");
    //系统共用的一些弹出框
    CXL.info = function (info) {
        top.layer.msg(info, { icon: 6 });
    };
    CXL.success = function (info) {
        top.layer.msg(info, { icon: 1 ,skin: 'my-layer-msg' });
    };
    CXL.error = function (info) {
        top.layer.alert(info, {
            icon: 2
        });
    };
    CXL.question = function (info) {
        top.layer.msg(info, { icon: 3 });
    };
    CXL.lock = function (info) {
        top.layer.msg(info, { icon: 4 });
    };
    CXL.warn = function (info) {
        top.layer.msg(info, { icon: 5 });
    };
    CXL.confirm = function (tip, ensure) {
        top.layer.confirm(tip, function () {
            ensure();
        });
    };
    CXL.load = function () {
        return top.layer.load();
    }
    CXL.closeByIndex = function (index, callback) {
        if (callback != undefined && callback != null && typeof callback == 'function') {
            top.layer.close(index, callback);
        } else {
            top.layer.close(index);
        }
    }
    CXL.getTextByJs = function (arr) {
        var str = "";
        for (var i = 0; i < arr.length; i++) {
            str += arr[i].id + ",";
        }
        //去掉最后一个逗号(如果不需要去掉，就不用写)
        if (str.length > 0) {
            str = str.substr(0, str.length - 1);
        }
        return str;
    }


    layui.use('laytpl', function () {

        //时间戳的处理
        layui.laytpl.toDateString = function (d, format) {
            var date = new Date(d || new Date())
                , ymd = [
                    this.digit(date.getFullYear(), 4)
                    , this.digit(date.getMonth() + 1)
                    , this.digit(date.getDate())
                ]
                , hms = [
                    this.digit(date.getHours())
                    , this.digit(date.getMinutes())
                    , this.digit(date.getSeconds())
                ];

            format = format || 'yyyy-MM-dd HH:mm:ss';

            return format.replace(/yyyy/g, ymd[0])
                .replace(/MM/g, ymd[1])
                .replace(/dd/g, ymd[2])
                .replace(/HH/g, hms[0])
                .replace(/mm/g, hms[1])
                .replace(/ss/g, hms[2]);
        };

        //时间戳的处理
        layui.laytpl.toDateStringNull = function (d, format) {
            if (null == d) {
                return "";
            }
            var date = new Date(d)
                , ymd = [
                    this.digit(date.getFullYear(), 4)
                    , this.digit(date.getMonth() + 1)
                    , this.digit(date.getDate())
                ]
                , hms = [
                    this.digit(date.getHours())
                    , this.digit(date.getMinutes())
                    , this.digit(date.getSeconds())
                ];

            format = format || 'yyyy-MM-dd HH:mm:ss';

            return format.replace(/yyyy/g, ymd[0])
                .replace(/MM/g, ymd[1])
                .replace(/dd/g, ymd[2])
                .replace(/HH/g, hms[0])
                .replace(/mm/g, hms[1])
                .replace(/ss/g, hms[2]);
        };

        //数字前置补零
        layui.laytpl.digit = function (num, length, end) {
            var str = '';
            num = String(num);
            length = length || 2;
            for (var i = num.length; i < length; i++) {
                str += '0';
            }
            return num < Math.pow(10, length) ? str + (num | 0) : num;
        };

    });

</script>
<style>
    /* 自定义样式 */
    .my-layer-msg {
        /*font-size: 20px;*/
        background: red;
        color: #1e1f22;
        /*font-weight: bold;*/
    }
</style>